package com.kms.dao;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.jdbc.support.incrementer.DataFieldMaxValueIncrementer;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.kms.model.MGroup;
import com.kms.model.MSyspara;

public class SystemparameterDAOImpl extends SqlMapClientDaoSupport implements SystemparameterDAO{


	private DataFieldMaxValueIncrementer seq_mgroup_id;
	


	public void delete(int id) {
		// TODO Auto-generated method stub
		
	}

	public void insert(MSyspara sysp) {
		// TODO Auto-generated method stub
		
	}

	public List<MSyspara> selectListmSyspara(MSyspara sysp) {
		// TODO Auto-generated method stub
		return null;
	}

	public MSyspara selectmSyspara(int id) {
		return (MSyspara) this.getSqlMapClientTemplate().queryForObject("Systemparameter.selectmsysparafromid", id);
	}

	public void update(MSyspara sysp) {
	}

	public void deleteSyspara(String id) {
		this.getSqlMapClientTemplate().delete("Systemparameter.deleteMsysparaFromMgid", id);
	}

	public void deletemGroup(String id) {
		this.getSqlMapClientTemplate().delete("Systemparameter.deleteMgroupFromId", id);
	}

	public void insertSyspara(MSyspara sysp) {
		this.getSqlMapClientTemplate().insert("Systemparameter.insertmSyspara", sysp);
	}

	public void insertmGroup(MGroup group) {
		this.getSqlMapClientTemplate().insert("Systemparameter.insertmGroup", group);
	}

	public List<MSyspara> selectListmmGroup(MGroup group) {
		// TODO Auto-generated method stub
		return null;
	}
	public List<MGroup> selectAllMGroup() {
		return this.getSqlMapClientTemplate().queryForList("Systemparameter.selectAllMGroup");
	}
	public MGroup selectmGroup(String id) {
		return (MGroup) this.getSqlMapClientTemplate().queryForObject("Systemparameter.selectMGroupById",id);
	}

	public void updateSyspara(MSyspara sysp) {
		this.getSqlMapClientTemplate().update("Systemparameter.updatemSyspara", sysp);
	}

	public void updatemGroup(MGroup group) {
		Map map = new HashMap();
		map.put("id", group.getId());
		map.put("name", group.getName());
		map.put("cname", group.getCname());
		map.put("lastmodified", group.getLastmodified());
		getSqlMapClientTemplate().update("Systemparameter.updatemgroupinfo", map);
	}

	public DataFieldMaxValueIncrementer getSeq_mgroup_id() {
		return seq_mgroup_id;
	}
	
	public void setSeq_mgroup_id(DataFieldMaxValueIncrementer seqMgroupId) {
		seq_mgroup_id = seqMgroupId;
	}


}
